package com.fitness.fitness.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fitness.fitness.modal.course.entity.CourseCategory;
import com.fitness.fitness.modal.course.params.CourseCategoryPageQueryParams;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface CourseCategoryMapper extends BaseMapper<CourseCategory> {
    @Select("<script>select * from t_course_category c "
            + " <where>"
            + "<if test='queryParams.keywords != null and queryParams.keywords.trim() neq \"\"'>"
            + " AND c.name like  CONCAT('%',#{queryParams.keywords},'%')"
            + "</if>"
            + "</where>"
            +"</script>")
    Page<CourseCategory> getCourseCategoryPage(Page<CourseCategory> page, @Param("queryParams") CourseCategoryPageQueryParams queryParams);
}
